<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>MaterialRecord管理</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	$(document).ready(function() {

	});
	function page(n, s) {
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
		return false;
	}
</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/warehouse/materialRecord/">MaterialRecord List</a></li>
		<shiro:hasPermission name="warehouse:materialRecord:edit">
			<li><a href="${ctx}/warehouse/materialRecord/form">MaterialRecord Add</a></li>
		</shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="materialRecord"
		action="${ctx}/warehouse/materialRecord/" method="post"
		class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
		<input id="pageSize" name="pageSize" type="hidden"
			value="${page.pageSize}" />
		<ul class="ul-form">
			
			<!-- 
			<li><label>createDate：</label> <input name="createDate"
				type="text" readonly="readonly" maxlength="20"
				class="input-medium Wdate"
				value="<fmt:formatDate value="${materialRecord.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
				onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});" />
			</li>
			 -->
			
			<li><label>office：</label> <sys:treeselect id="office"
					name="office.id" value="${materialRecord.office.id}"
					labelName="office.name" labelValue="${materialRecord.office.name}"
					title="部门" url="/sys/office/treeData?type=2" cssClass="input-small"
					allowClear="true" notAllowSelectParent="true" /></li>
			
			<li><label>in_out：</label> <form:select path="inOut"
					class="input-medium">
					<form:option value="" label="" />
					<form:options items="${fns:getDictList('inout')}" itemLabel="label"
						itemValue="value" htmlEscape="false" />
				</form:select></li>
			<li>
				<label>updateDate：&nbsp;</label><input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
					value="<fmt:formatDate value="${materialRecord.beginDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
				&nbsp;--&nbsp;<input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
					value="<fmt:formatDate value="${materialRecord.endDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>&nbsp;&nbsp;
			</li>
			
					
			<li class="btns"><input id="btnSubmit" class="btn btn-primary"
				type="submit" value="Search" /></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}" />
	<table id="contentTable"
		class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>Material</th>
				<th>in_out</th>
				<th>count</th>
				<th>updateDate</th>
				<th>updateBy</th>
				<th>office</th>
				<shiro:hasPermission name="warehouse:materialRecord:edit">
					<th>OP</th>
				</shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${page.list}" var="materialRecord">
				<tr>
					<td><a
						href="${ctx}/warehouse/materialRecord/form?id=${materialRecord.id}">
							${materialRecord.material.name} </a></td>
					<td>${fns:getDictLabel(materialRecord.inOut, 'inout', '')}</td>
					<td>${materialRecord.count}</td>
					<td><fmt:formatDate value="${materialRecord.updateDate}"
							pattern="yyyy-MM-dd HH:mm:ss" /></td>
					<td>${materialRecord.updateBy.name}</td>
					<td>${materialRecord.office.name}</td>
					<shiro:hasPermission name="warehouse:materialRecord:edit">
						<td>							
							<a
							href="${ctx}/warehouse/materialRecord/form?id=${materialRecord.id}">Modify</a>
							<a
							href="${ctx}/warehouse/materialRecord/delete?id=${materialRecord.id}"
							onclick="return confirmx('确认要删除该MaterialRecord吗？', this.href)">Delete</a>
						</td>
					</shiro:hasPermission>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>